home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 February / EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso / earcd / comm2 / rpgbbs3.lha / Include / xem.h < prev   
C/C++ Source or Header  |  1992-07-19  |  4KB  |  126 lines

  1. /**
  2. *
  3. *   Include file for External Emulator Handling
  4. *
  5. **/
  6. /*
  7. *   The structure
  8. */
  9. struct XEM_IO {
  10.     struct Window  *xem_window;    /* window to display text */
  11.     struct TextFont *xem_font;        /* default font (like topaz 8) */
  12.     APTR        xem_console;            /* PRIVATE DATA..!! */
  13.     ULONG        xem_obsolete1;            /* */
  14.     ULONG        *xem_signal;            /* signal mask generated by xem */
  15.     UWORD        xem_screendepth;        /* count of bitplanes */
  16.     UWORD        xem_pad;                    /* just a pad */
  17.  
  18. /* Read a few bytes from the serial port (including timeouts). */
  19.     LONG        (*xem_sread)(UBYTE *buffer, LONG size, LONG timeout);
  20.  
  21. /* Send a few bytes across the serial line. */
  22.     LONG        (*xem_swrite)(UBYTE *buffer, LONG size);
  23.  
  24. /* Release the contents of all serial buffers. */
  25.     LONG        (*xem_sflush)(VOID);
  26.  
  27. /* Send a break signal across the serial line. */
  28.     LONG        (*xem_sbreak)(VOID);
  29.  
  30. /* Check how many characters are present in the serial buffer. */
  31.     LONG        (*xem_squery)(VOID);
  32.  
  33. /* Restart serial read activity. */
  34.     VOID        (*xem_sstart)(VOID);
  35.  
  36. /* Stop serial read activity. */
  37.     LONG        (*xem_sstop)(VOID);
  38.  
  39. /* Beep the terminal display. */
  40.     VOID        (*xem_tbeep)(ULONG ntimes, ULONG delay);
  41.  
  42. /*    Get a string from the user. */
  43.     LONG        (*xem_tgets)(UBYTE *prompt, UBYTE *buffer, ULONG buflen);
  44.  
  45. /*     Provide a polished user interface to set the emulator options. */
  46.     ULONG        (*xem_toptions)(LONG n, struct xem_option *opt[]);
  47.  
  48. /* Dispatch a macro key call. */
  49.     LONG        (*xem_process_macrokeys)(struct XEmulatorMacroKey *key);
  50. };
  51.  
  52.  
  53. #define XEM_LIBRARY_VERSION 4
  54.  
  55.  
  56. /*
  57. *   The xemo_option structure
  58. */
  59. struct xem_option {
  60.     UBYTE    *xemo_description;    /* description of the option                  */
  61.     ULONG    xemo_type;                /* type of option                             */
  62.    UBYTE    *xemo_value;            /* pointer to a buffer with the current value */
  63.    ULONG    xemo_length;            /* buffer size                                */
  64. };
  65. /*
  66. *   Valid values for xemo_type are:
  67. */
  68. #define XEMO_BOOLEAN 1L         /* xemo_value is "yes", "no", "on" or "off"   */
  69. #define XEMO_LONG    2L         /* xemo_value is string representing a number */
  70. #define XEMO_STRING  3L         /* xemo_value is a string                     */
  71. #define XEMO_HEADER  4L         /* xemo_value is ignored                      */
  72. #define XEMO_COMMAND 5L         /* xemo_value is ignored                      */
  73. #define XEMO_COMMPAR 6L         /* xemo_value contains command parameters     */
  74.  
  75.  
  76. struct XEmulatorMacroKey {
  77.     struct MinNode xmk_Node;
  78.     UWORD    xmk_Qualifier;
  79.     UBYTE    xmk_Type;
  80.     UBYTE    xmk_Code;
  81.     APTR    xmk_UserData;
  82. };
  83.  
  84. /*----- Qualifiers for XMK_QUALIFIER -----*/
  85. #define XMKQ_NONE      0
  86. #define XMKQ_SHIFT     1
  87. #define XMKQ_ALTERNATE 2
  88. #define XMKQ_CONTROL   3
  89.  
  90. /*----- Types for XMK_TYPE -----*/
  91. #define XMKT_IGNORE 1
  92. #define XMKT_RAWKEY 2
  93. #define XMKT_COOKED 3
  94.  
  95.  
  96. /*----- Types for XEmulatorInfo -----*/
  97. #define XEMI_CURSOR_POSITION        1    /* home = 1,1 */
  98. #define XEMI_CONSOLE_DIMENSIONS    2    /* */
  99.  
  100. /*----- Macros for XEmulatorInfo -----*/
  101.         /* for use in xem.library */
  102. #define XEMI_CREATE_POSITION(ypos,xpos) ((ypos << 16) + (xpos & 0xffff))
  103. #define XEMI_CREATE_DIMENSIONS(columns,lines) ((columns << 16) + (lines & 0xffff))
  104.  
  105.         /* for use in comm-proggy */
  106. #define XEMI_EXTRACT_Y_POSITION(result) (result >> 16)
  107. #define XEMI_EXTRACT_X_POSITION(result) (result & 0xffff)
  108.  
  109. #define XEMI_EXTRACT_COLUMNS(result)    (result >> 16)
  110. #define XEMI_EXTRACT_LINES(result)        (result & 0xffff)
  111.  
  112.  
  113. /*----- Modes for XEmulatorPreferences -----*/
  114. #define XEM_PREFS_RESET    0    /* Reset to builtin defaults    */
  115. #define XEM_PREFS_LOAD    1    /* Load preferences from file    */
  116. #define XEM_PREFS_SAVE    2    /* Save preferences to file    */
  117.  
  118.  
  119. struct XEmulatorHostData {
  120.     UBYTE *Source;            /* Pointer to the source buffer */
  121.     UBYTE *Destination;    /* Pointer to the destination buffer */
  122.     BOOL InESC;            /* INTER-EMULATOR PRIVATE DATA..  DO NOT TOUCH 'EM..!! */
  123.     BOOL InCSI;            /* INTER-EMULATOR PRIVATE DATA..  DO NOT TOUCH 'EM..!! */
  124. };
  125.  
  126.